home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / FPGAWKII.ZIP / SRAM.PDS < prev    next >
Text File  |  1995-02-18  |  2KB  |  70 lines

  1. ; This example demonstrates different
  2. ; ways to use the SRAMs in the EPX780.
  3. ;
  4. ; SET COMPILER OPTIONS TO:
  5. ;  Use Design Pin Assignments, but not
  6. ;               Previous, Abort on no fit
  7.  
  8. CHIP product NFX780_84
  9.  
  10. PIN 3  CLK1 ; synchronous clock pin 1
  11. PIN 45 CLK2 ; synchronous clock pin 2
  12.  
  13. PIN    a[0:6] ; address pins
  14. PIN    d[9:0] ; data pins
  15. PIN    we_    ; write enable
  16. PIN    oe_    ; output enable
  17. PIN    be_    ; block enable
  18.  
  19. PIN    rama[3:0]  RAM ; a 128x4 SRAM
  20. PIN    ramb[9:0]  RAM REG ; a 128x10 SRAM
  21.                   ; with registered outputs
  22.  
  23. ; initialize all locations in SRAM
  24. ; rama with 0x4 and then load the first
  25. ; location with 0x3 and the next fifteen
  26. ; locations with 0x7
  27. RAM_DEFAULTS rama DEFAULT_VALUE 0x4
  28.   0x00        : 0x3
  29.   [0x01:0x0F] : 0x7
  30.  
  31. ; initialize all locations in SRAM
  32. ; ramb with 0x3FF and then load the first
  33. ; sixteen locations with zero
  34. RAM_DEFAULTS ramb DEFAULT_VALUE 0x3FF
  35.   [0x00:0x1F] : 0x0
  36.  
  37. EQUATIONS
  38.  
  39. ; use only the first 32 locations of rama
  40. rama[4:0].ADDR = a[4:0]
  41. ; connect only four data inputs to rama
  42. rama[3:0].DATA = d[3:0]
  43. ; always enable rama
  44. /rama.BE = GND;
  45. ; make rama into a read-only memory
  46. rama.WE = GND
  47. ; always enable memory output from rama
  48. rama.TRST = VCC
  49.  
  50. ; use all the locations
  51. ramb[6:0].ADDR = a[6:0]
  52. ; use all the data inputs
  53. ramb[9:0].DATA = d[9:0]
  54. ; connect write, block, and output enables
  55. /ramb.WE = we_
  56. /ramb.BE = be_
  57. /ramb.TRST = oe_
  58. ; clock ram outputs into register on the
  59. ; rising edge of CLK1
  60. ramb.CLKF = CLK1
  61.  
  62. SIMULATION
  63. VECTOR address := [a6,a5,a4,a3,a2,a1,a0]
  64. SETF we_ /be_ /oe_ /CLK1 
  65. FOR i:=0 TO 40 DO
  66.     BEGIN
  67.     SETF address := i
  68.     CLOCKF CLK1
  69.     END
  70.